package com.entity;

import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 【物业项目】 月度收支情况
 */

@Entity
@Table(name = "property_monthly_finance")
@Getter @Setter @NoArgsConstructor
public class PropertyMonthlyFinance extends BaseEntity {

    private String projectName;

    @Column
    @Temporal(TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
    private Date financeMonth;

    @Column(name = "income_amount", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal incomeAmount = BigDecimal.ZERO;

    @Column(name = "expense_amount", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal expenseAmount = BigDecimal.ZERO;

    @Column(name = "balance", precision = 15, scale = 2)
    private BigDecimal balance = BigDecimal.ZERO;

    @Column(name = "finance_status", columnDefinition = "TINYINT default 1")
    private Integer financeStatus;

    @Column(name = "remark", length = 500)
    private String remark;

}